<#include "../../common/meta.ftl">
	<script>
		function selectPic(){
            $('#pic').click();
        }
		function readFile(){
			var reader = new FileReader();
			var file=document.getElementById("pic").files[0];
	        reader.onload = function(e) {
			    $('#imgView').attr('src',e.target.result+'');
			}
            reader.readAsDataURL(file);
            document.getElementById("button").disabled=false;
        }
	</script>
	<style>
		.w190{width:270px;heiht:300px}
		.imgWrap{position:relative;margin-left:2px;margin-right:2px;z-index:90;float:left;}
		.imgWrap .bg1{position:absolute;right:-3px;bottom:-3px;background-color:#E3E3E3;width:100%;height:100%;z-index:91;}
		.imgWrap .bg2{position:absolute;left:-3px;top:-3px;background-color:#fff;width:100%;height:100%;border:1px solid #E3E3E3;z-index:92;}
		.imgWrap .imgDiv{width:100%;height:100%;position:relative;z-index:98;}
		.imgWrap .imgDiv div{width:100%;height:100%;padding:10px 13px 13px 7px;}
		.imgWrap .imgDiv div img{width:250px;height:250px}
		.imgWrap .info{position:relative;z-index:99;padding:10px;}
	</style>
</head>
<body>
	<input id="ctxPath" value="${ctx.contextPath}" type="hidden" />
	
	<div class="head">
		<div class="path">欢迎页管理 &gt; 欢迎页管理</div>
	</div>
	<div class="contents">
		<form id="bookForm" action="${ctx.contextPath}/rest/config/welcome/pic/save"   enctype="multipart/form-data" method="POST">
			<div class="adsView" style='height:300px;'>
				<div class="imgWrap w190">
			     <div class="bg1"></div>
			     <div class="bg2"></div>
			     <div class="imgDiv">
			      <div><a href="#"><img alt='点击换图' id='imgView' src="<#if mc??>${mc.configValue!''}<#else>${ctx.contextPath}/images/default/ads1.jpg</#if>" onclick='selectPic()' onError='${ctx.contextPath}/images/default/ads1.jpg' /></a></div>
			     </div>
			    </div>
			</div>
			<input type='file' name='pic' onchange='readFile()' accept='image/*' id='pic' style='display:none'>
			<input type='submit' style='display:block;' id='button' disabled='true' value='保存' >
		</form>
	</div>
</body>
</html>
